﻿using LatoolNet;

namespace NumericalSolution {
  abstract class ConvectionDiffusion1D {
    protected int p_numberOfControlVolumes;
    protected double p_deltax;
    protected double p_rho;
    protected double p_u;
    protected double p_gamma;

    public int NumberOfControlVolumes {
      get { return p_numberOfControlVolumes; }
      set {
        p_numberOfControlVolumes = value;
        p_deltax = 1.0 / p_numberOfControlVolumes;
      }
    }

    public double Rho {
      get { return p_rho; }
      set { p_rho = value; }
    }

    public double Gamma {
      get { return p_gamma; }
      set { p_gamma = value; }
    }

    public double U {
      get { return p_u; }
      set { p_u = value; }
    }

    public double DeltaX {
      get { return p_deltax; }
    }

    public double posx(int i) {
      return p_deltax / 2.0 + i * p_deltax;
    }

    public abstract Matrix Solve();

  }
}
